<%@ page import="com.XiGuaXiaoMe.entity.course" %>

<%@ page import="java.util.List" %>
<%@ page import="com.XiGuaXiaoMe.entity.Users" %>
<%@ page import="com.XiGuaXiaoMe.dao.DaoSc" %>
<%@ page import="com.XiGuaXiaoMe.entity.SC" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.XiGuaXiaoMe.entity.SC2" %><%--

  Created by IntelliJ IDEA.
  User: jl
  Date: 2021/11/10
  Time: 22:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html lang="zh-CN">
<head>
    <meta charset="utf-8" />

    <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
    <link rel="stylesheet" href="../CSS/css/jquery.paginate.css" />
    <link rel="stylesheet" href="../CSS/css/jquery.yhhDataTable.css" />
    <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="../JS/js/jquery.paginate.js" ></script>
    <script type="text/javascript" src="../JS/js/jquery.yhhDataTable.js" ></script>
    <script type="text/javascript" src="../JS/js/index.js" ></script>
    <link rel="stylesheet" href="../CSS/toPage.css">

    <link rel="stylesheet" href="../font_cqbiizu5og9/iconfont.css">
    <title>自适应导航栏</title>
    <link rel="stylesheet" type="text/css" href="../CSS/导航栏c.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/搜索框样式.css">
    <link rel="stylesheet" type="text/css" href="../CSS/table.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/mainpage.css" />

    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700i" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="../CSS/button.css" />


</head>
<body style="padding-bottom:10px;">


<iframe class="obj1" src="head.html" frameborder="0" width="1300px" height="90px" scrolling="no"></iframe>
<div class="shell" style=" background-color: #bb3e03;">
    <a href="userinformation.jsp" class="box" style="color: #faedcd;" ><i class="iconfont icon-liebiao"></i><span>个人信息</span></a>
    <a href="课程表1.jsp" class="box" style="color: #faedcd;"><i class="iconfont icon-cangku"></i><span> 查看课表</span></a>
    <a href="/MyWeb/Student/coursefind" class="box"style="color: #faedcd;"><i class="iconfont icon-zhuti_tiaosepan"></i><span>选课</span></a>
    <a href="coursescore.jsp" class="box"style="color: #faedcd;"><i class="iconfont icon-qianbao"></i><span>课程成绩</span></a>
    <a href="日历3.html" class="box" style="color: #faedcd;"><i class="iconfont icon-dunpaibaoxianrenzheng"></i><span>日历</span></a>
    <a href="#" class="box"style="color: #faedcd;"><i class="iconfont icon-dengchu" onclick="shut()"></i><span>退出系统</span></a>
</div>
<section>
    <%
        String sno=null;
        Users user = null;
        if(session.getAttribute("user")==null){
            response.sendRedirect("/User_Add.jsp");
        }else {
            user = (Users) session.getAttribute("user");

            sno=user.getUserName3();
            System.out.println(sno);
        }

    %>

    <%--<div class="navbar">
        <!-- 复选框的id属性值和label元素的for属性值相同的话 那么就可以通过label元素选中复选框 -->
        <input type="checkbox" id="nav" /><label for="nav"></label>
        <ul>
            <li><a href="javascript:;">选课管理</a></li>
            <li><a href="javascript:;">我的选课</a></li>
        </ul>
    </div>--%>
      <input type="button" id="btn" value="导出为表格">
    <%--<div class="b">
        <div class="btn-box">

            <div class="box3">
                <span class="ripple"></span>
                <p ><a id="btn" style="color: white;text-decoration: none"> 导出为表格</a></p>
            </div>

        </div>
    </div>--%>
    <br><br>
    <%--<input type="button" class="exportExcelt" value="点击导出成绩表">--%>
    <div class="container">
        <!--分页容器_1-->

        <table id="testtable1" class="data-table" >

            <thead>
            <tr>
                <th>课程名称</th>
                <th>课序号</th>
                <th>代课老师</th>

                <th>课堂成绩</th>
                <th>成绩排名</th>

            </tr>
            </thead>
            <tbody>
            <%
                DaoSc select=new DaoSc();
                Iterator<SC2> list = select.selectSc2(user.getUserName3());
                SC2 cou = null;

                while(list.hasNext()) {
                    cou = list.next();
                    int c=cou.getXuhao();
                    DaoSc sc=new DaoSc();
                    int paiming=sc.selectpaiming(sno,c)+1;
            %>

            <tr>
                <td><%=cou.getXuhao()%></td>
                <td><%=cou.getName()%></td>
                <td><%=cou.getTeacher()%></td>
                <td><%=cou.getScore()%></td>
                <td><%=paiming%></td>


            </tr>
                <%}%>



            </tbody >
        </table>


    </div>

</section>
<script src="../JS/jquery-table2excel-master/dist/jquery.table2excel.js"></script>

<script>
    $('#btn').click(function () {
        $("#testtable1").table2excel({ //这里要选择table标签 我这里是用id选择 也可$('table').table2excel()
           /* exclude:'.not',   *///不被导出表格行的class类
            name:'学生本学期成绩',     //文档名称
            filename:'成绩', //文件名称
            exclude_img:false, //是否导出图片
            exclude_links:false,//是否导出超链接
            exclude_inputs:false//是否导出input框中的内容
        });
    });
</script>



</body>


</html>